<!DOCTYPE HTML>
<html>
    <head>
        <title>HTML学习笔记</title>
        <meta charset='utf-8'>
        <!--<style type='text/css'>-->
            <!--*{-->
                <!--background-image: url("img/13.jpg");-->
            <!--}-->
        <!--</style>-->
        <script>
            var myTime = function() {
                var d = new Date();//表明生成了一个日期对象
                var year = d.getFullYear();
                var month = d.getMonth();//从0开始
                var date = d.getDate();
                var week = d.getDay();
                switch (week) {
                    case 0:
                        week = "日";
                        break;
                    case 1:
                        week = "一";
                        break;
                    case 2:
                        week = "二";
                        break;
                    case 3:
                        week = "三";
                        break;
                    case 4:
                        week = "四";
                        break;
                    case 5:
                        week = "五";
                        break;
                    case 6:
                        week = "六";
                        break;
                    default:
                        break;
                }
                var hour = d.getHours();
                var minute = d.getMinutes();
                var second = d.getSeconds();
                var ms = d.getMilliseconds();
                var pv = document.getElementById('p1');
                pv.textContent = '今天是 : 星期' + week + ' ' + year + '年' + (month + 1) + '月' + date + '日' + hour + ':' + minute + ':' + second;
            };
            window.onload = function() {
                //setInterval 按照时间 间隔来循环执行
                //参数1: 脚本内容
                //参数2: 时间单位 (ms) 1000ms = 1s
                myTime();
                window.setInterval(myTime, 100);

            };
        </script>
    </head>
    <body>
    <div>
    <iframe  width="420"
             scrolling="no"
             height="60"
             frameborder="0"
             allowtransparency="true"
             src="http://i.tianqi.com/index.php?c=code&id=12&icon=1&num=5"></iframe></div>
    <div id = 'p1'
         style = 'position:absolute;
         right:5px;top:0;font-size:24px;
         text-align: center;line-height: 40px;
            min-width:400px;height:40px;'>

    </div>
         <div style='text-align:center;font-family:"微软雅黑"'>张相杰</div>
    </body>
</html>
